﻿@model Great_Eggspectations.ViewModels.HomeIndexViewModel
@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>Great Eggspectations</h1>
    <p class="lead">Log your farm partners, transactions, and products.</p>
</div>

<div class="row">
    <div class="col-md-12">
        <h2>Transactions</h2>
        @Html.Partial("_TransactionsIndexTable", Model.TransactionsIndexTableViewModel)
        <p>@Html.ActionLink("Transactions Index", "Index", "Transaction", new { page = 1, pageCount = 25 }, new { @class = "btn btn-default" })</p>
    </div>
</div>

<div class="row">
    <div class="col-md-6">
        <h2>Partners</h2>
        @Html.Partial("_PartnersIndexTable", Model.PartnersPagedList)
        <p>@Html.ActionLink("Partners Index", "Index", "Partner", new { page = 1, pageCount = 25 }, new { @class = "btn btn-default" })</p>
    </div>
    <div class="col-md-6">
        <h2>Products</h2>
        @Html.Partial("_ProductsIndexTable", Model.ProductsPagedList)
        <p>@Html.ActionLink("Products Index", "Index", "Product", new { page = 1, pageCount = 25 }, new { @class = "btn btn-default" })</p>
    </div>
</div>

<div class="row">
    <div class="col-md-6">
        <h2>Partner Tags</h2>
        <ul>
            @foreach (var tag in Model.PartnerTags.OrderByDescending(t => t.Item2))
            {
                <li>
                    @Html.ActionLink(tag.Item1, "Index", "Partner", new { tag = tag.Item1 }, new { })
                    (@tag.Item2)
                </li>
            }
        </ul>
    </div>
    <div class="col-md-6">
        <h2>Product Tags</h2>
        <ul>
            @foreach (var tag in Model.ProductTags.OrderByDescending(t => t.Item2))
            {
                <li>
                    @Html.ActionLink(tag.Item1, "Index", "Product", new { tag = tag.Item1 }, new { })
                    (@tag.Item2)
                </li>
            }
        </ul>
    </div>
</div>

